package cn_dk;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;


/**
 * @Auther:dingkai
 * @date:2021/11/26 0026 下午 3:48
 * @Desc:
 */
@WebServlet(urlPatterns = "/ServletDemo")
public class ServletDemo extends HttpServlet {
  // 请求为post走post
    protected  void doPost(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException {
        System.out.println("我是post");
    }
    //请求为post走doGet
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        System.out.println("我是get");

    }

}
